namespace TerritoryGame.Domain.ValueObjects;

public record GameScore(int Value)
{
    public int Area => Value; // 添加Area属性作为Value的别名
    
    public static GameScore Zero => new(0);
    
    public static GameScore operator +(GameScore a, GameScore b)
    {
        return new GameScore(a.Value + b.Value);
    }
    
    public static GameScore operator -(GameScore a, GameScore b)
    {
        return new GameScore(Math.Max(0, a.Value - b.Value));
    }
    
    public static bool operator >(GameScore a, GameScore b)
    {
        return a.Value > b.Value;
    }
    
    public static bool operator <(GameScore a, GameScore b)
    {
        return a.Value < b.Value;
    }
    
    public static bool operator >=(GameScore a, GameScore b)
    {
        return a.Value >= b.Value;
    }
    
    public static bool operator <=(GameScore a, GameScore b)
    {
        return a.Value <= b.Value;
    }
    
    public static implicit operator int(GameScore score) => score.Value;
}
